﻿<Window x:Class="HMS.ScanWindow"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
        xmlns:xctk="clr-namespace:Xceed.Wpf.Toolkit;assembly=WPFToolkit.Extended"
        Style="{StaticResource ControlBackgroundStyle}"
        WindowStartupLocation="CenterScreen"
        ResizeMode="NoResize"
        Title="Scan"
        Height="506" Width="494">
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />

        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal">
            <StackPanel Orientation="Vertical" Grid.Row="0">

                <GroupBox Header="Scan Details" Grid.Row="0"  Background="{x:Null}">
                    <WrapPanel Orientation="Vertical">
                        <StackPanel Name="ReferenceStackPanel"  Orientation="Horizontal">
                            <Label Content="Reference:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <toolkit:AutoCompleteBox Name="ReferenceAutocompleteTextBox" 
                                                 ItemsSource="{Binding}"
                                                 ValueMemberPath="Reference"
                                                 ToolTipService.ToolTip="Enter Reference."
                                                 IsTextCompletionEnabled="True"
                                                 Style="{StaticResource LeftAlignedControlAutoCompleteTextBoxStyle}" 
                                                 FilterMode="StartsWith" SelectionChanged="ReferenceAutocompleteTextBox_SelectionChanged">
                                <toolkit:AutoCompleteBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding Path=Reference}"/>
                                            <TextBlock Text="-"/>
                                            <TextBlock Text="{Binding Path=Patient.Name}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </toolkit:AutoCompleteBox.ItemTemplate>
                            </toolkit:AutoCompleteBox>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="Main Category:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <toolkit:AutoCompleteBox Name="ScanMainCategoryAutocompleteTextBox" 
                                                 ItemsSource="{Binding}"
                                                 ValueMemberPath="Name"
                                                 ToolTipService.ToolTip="Enter Report Type."
                                                 IsTextCompletionEnabled="True"
                                                 Style="{StaticResource LeftAlignedControlAutoCompleteTextBoxStyle}" 
                                                 FilterMode="StartsWith" SelectionChanged="ScanMainCategoryAutocompleteTextBox_SelectionChanged">
                                <toolkit:AutoCompleteBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding Path=Name}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </toolkit:AutoCompleteBox.ItemTemplate>
                            </toolkit:AutoCompleteBox>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="Sub Category:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <toolkit:AutoCompleteBox Name="ScanSubCategoryAutocompleteTextBox" 
                                                 ItemsSource="{Binding}"
                                                 ValueMemberPath="Name"
                                                 ToolTipService.ToolTip="Enter Report Type."
                                                 IsTextCompletionEnabled="True"
                                                 Style="{StaticResource LeftAlignedControlAutoCompleteTextBoxStyle}" 
                                                 FilterMode="StartsWith" SelectionChanged="ScanSubCategoryAutocompleteTextBox_SelectionChanged">
                                <toolkit:AutoCompleteBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding Path=Name}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </toolkit:AutoCompleteBox.ItemTemplate>
                            </toolkit:AutoCompleteBox>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="Doctor/Scan Type:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <toolkit:AutoCompleteBox Name="ScanTypeAutocompleteTextBox" 
                                                 DataContext="{Binding}"
                                                 ValueMemberPath="Doctor.Name"
                                                 IsTextCompletionEnabled="True"
                                                 Style="{StaticResource LeftAlignedControlAutoCompleteTextBoxStyle}" 
                                                 FilterMode="StartsWith" SelectionChanged="ScanTypeAutocompleteTextBox_SelectionChanged">
                                <toolkit:AutoCompleteBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding Path=ReportSubCategory.Name}"/>
                                            <TextBlock Text="-"/>
                                            <TextBlock Text="{Binding Path=Doctor.Title}"/>
                                            <TextBlock Text="{Binding Path=Doctor.Name}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </toolkit:AutoCompleteBox.ItemTemplate>
                            </toolkit:AutoCompleteBox>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="Appointment :" VerticalAlignment="Top" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <DatePicker Name="AppointmentDatePicker" Style="{StaticResource LeftAlignedControlDatePickerStyle}" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="Collection :" VerticalAlignment="Top" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <DatePicker  Name="CollectionDatePicker" Style="{StaticResource LeftAlignedControlDatePickerStyle}" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="Urgent :" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <CheckBox Name="IsUrgentCheckBox" IsChecked="False" Style="{StaticResource LeftAlignedControlCheckBoxStyle}" Checked="IsUrgentCheckBox_Checked" Unchecked="IsUrgentCheckBox_Unchecked" />
                        </StackPanel>
                    </WrapPanel>
                </GroupBox>
                <GroupBox Header="Patient Details" Grid.Row="0" Background="{x:Null}">
                    <WrapPanel Orientation="Vertical">
                        <StackPanel Orientation="Horizontal">
                            <Label Content="Patient Name:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <TextBox Name="PatientNameTextBox" Style="{StaticResource LeftAlignedControlTextBoxStyle}"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="Contact No:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <xctk:MaskedTextBox Mask="0000-000000" Value="0112898476" Name="PatientContactNoTextBox" Style="{StaticResource LeftAlignedControlTextBoxStyle}"/>
                        </StackPanel>
                    </WrapPanel>
                </GroupBox>
                <GroupBox Header="Payment Details" Grid.Row="0" Background="{x:Null}">
                    <WrapPanel Orientation="Vertical">
                        <StackPanel Name="PaymentMethodStackPanel" Orientation="Horizontal">
                            <Label Content="Payment Method:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <ComboBox Name="PaymentMethodComboBox"  Style="{StaticResource LeftAlignedControlComboboxBoxStyle}"
                                  SelectedValuePath="PaymentMethodID" 
                                  DisplayMemberPath="Name"
                                  ItemsSource="{Binding}"/>
                        </StackPanel>
                        <StackPanel   Orientation="Horizontal" HorizontalAlignment="Left">
                            <StackPanel Orientation="Horizontal">
                                <Label Content="Print Receipt :" Style="{StaticResource RightAlignedControlLabelStyle}" />
                                <CheckBox Name="PrintReceiptCheckBox" IsChecked="True" Style="{StaticResource LeftAlignedControlCheckBoxStyle}"  />
                            </StackPanel>
                        </StackPanel>
                    </WrapPanel>

                </GroupBox>

            </StackPanel>
            <GroupBox Header="Summary" Grid.Row="0" HorizontalAlignment="Stretch" Background="{x:Null}">
                <WrapPanel Orientation="Vertical">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock   FontSize="13" Style="{StaticResource RightAlignedControlTextBlockStyle}">Hospital Fee:</TextBlock>
                        <TextBlock Name="HospitalFeeTextBlock"  FontSize="16" Style="{StaticResource LeftAlignedControlTextBlockStyle}">0.00</TextBlock>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock   FontSize="13" Style="{StaticResource RightAlignedControlTextBlockStyle}">Doctor Fee:</TextBlock>
                        <TextBlock Name="DoctorFeeTextBlock" FontSize="16" Style="{StaticResource LeftAlignedControlTextBlockStyle}">0.00</TextBlock>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock   FontSize="13" Style="{StaticResource RightAlignedControlTextBlockStyle}">Urgent fee:</TextBlock>
                        <TextBlock Name="UrgentFeeTextBlock" FontSize="16" Style="{StaticResource LeftAlignedControlTextBlockStyle}">0.00</TextBlock>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock   FontSize="13" Style="{StaticResource RightAlignedControlTextBlockStyle}">Total Amount:</TextBlock>
                        <TextBlock Name="TotalReceiptAmountTextBlock" FontSize="20" Style="{StaticResource LeftAlignedControlTextBlockStyle}">0.00</TextBlock>
                    </StackPanel>
                </WrapPanel>
            </GroupBox>
        </StackPanel>
        <Rectangle  Grid.Row="1"  Style="{StaticResource HorizontalLineStyle }" />
        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Name="NewButton"  Style="{StaticResource LargeButtonStyle}" Click="NewButton_Click">
                <StackPanel Orientation="Horizontal" >
                    <Image   Source="images/icons/24x24/new.png" Style="{StaticResource Image24x24Style}" />
                    <TextBlock  FontSize="16" Style="{StaticResource ButtonTextControlTextBlockStyle}">New</TextBlock>
                </StackPanel>
            </Button>
            <Button Name="PrintButton"  Style="{StaticResource LargeButtonStyle}" Click="PrintButton_Click">
                <StackPanel Orientation="Horizontal" >
                    <Image   Source="images/icons/24x24/print.png" Style="{StaticResource Image24x24Style}" />
                    <TextBlock  FontSize="16" Style="{StaticResource ButtonTextControlTextBlockStyle}">Print</TextBlock>
                </StackPanel>
            </Button>
            <Button Name="SaveButton"  Style="{StaticResource LargeButtonStyle}" Click="SaveButton_Click">
                <StackPanel Orientation="Horizontal" >
                    <Image Source="images/icons/24x24/right.png" Style="{StaticResource Image24x24Style}" />
                    <TextBlock FontSize="16" Style="{StaticResource ButtonTextControlTextBlockStyle}">Save</TextBlock>
                </StackPanel>
            </Button>
            <Button Name="RefreshSummaryButton"  Style="{StaticResource LargeButtonStyle}">
                <StackPanel Orientation="Horizontal" >
                    <Image Source="images/icons/24x24/refresh.png" Style="{StaticResource Image24x24Style}" />
                    <TextBlock FontSize="16" Style="{StaticResource ButtonTextControlTextBlockStyle}">Refresh</TextBlock>
                </StackPanel>
            </Button>

            <Button Name="CancelButton"  Style="{StaticResource LargeButtonStyle}" Click="CancelButton_Click">
                <StackPanel Orientation="Horizontal" >
                    <Image Source="images/icons/24x24/cross.png" Style="{StaticResource Image24x24Style}" />
                    <TextBlock FontSize="16" Style="{StaticResource ButtonTextControlTextBlockStyle}">Close</TextBlock>
                </StackPanel>
            </Button>
        </StackPanel>


    </Grid>
</Window>
